ReadFromFile Method (Field Object) 

The ReadFromFile method loads the value of a string or binary field from the specified file.

Syntax

objField.ReadFromFile(fileName)

Parameters

objField

Required. The Field object.

fileName

Required. The full path and file name to read. For example, C:\DOCUMENT\BUDGET.XLS.

 

Remarks

The ReadFromFile method reads the string or binary value from the specified file name and stores it as the value of the Field object. It replaces any previously existing value for the field.

Note that ReadFromFile is not supported for simple types, such as Integer, Long, and Boolean. Visual Basic provides common functions to read and write these base types to and from files. The ReadFromFile method fails if the Type property of the Field object is not a string or binary type.

Note that some binary types are converted to a hexadecimal string format when they are stored as Field values. Comparison operations on the Value property and the actual contents of the file can return  not equal,  even though the values are equivalent.

ReadFromFile returns MAPI_E_INTERFACE_NOT_SUPPORTED for Field objects obtained from a Folder object s Fields collection.

 

See Also

WriteToFile, Method (Field Object)